<?php

/*
|--------------------------------------------------------------------------
| Admin Routes
|--------------------------------------------------------------------------
|
| This file is where you may override any of the routes that are included
| with Voyager.
|
*/

Route::group(['as' => 'user.','prefix'=>'admin'], function () {

    $namespacePrefix = '\\App\\Admin\\Controllers\\Users\\';

    Route::group(['middleware' => ['admin.user']], function () use ($namespacePrefix) {


        
        Route::get('/users/add', ['uses' => $namespacePrefix . 'UserController@add', 'as' => 'add']);
        Route::post('users/add', ['uses' => $namespacePrefix . 'UserController@post_add', 'as' => 'post_add']);
        Route::delete('users/delete/{id?}', ['uses' => $namespacePrefix . 'UserController@deleteUser', 'as' => 'delete']);
        Route::post('users/get_superiors', ['uses' => $namespacePrefix . 'UserController@getSuperiors', 'as' => 'get_superiors']);
        Route::get('users/choose_new_user', ['uses' => $namespacePrefix . 'UserController@chooseNewUser', 'as' => 'choose_new_user']);
        Route::get('users', ['uses' => $namespacePrefix . 'UserController@index', 'as' => 'users']);

    });

});
